/**
 * Created by a1 on 2017/10/17.
 */
"use strict";
function extend(target, source) {
    for (var obj in source) {
        target[obj] = source[obj];
    }
    return target;
}
function getTimes(nS,type) {
    var date=new Date(parseInt(nS));
    var year=date.getFullYear();
    var mon = date.getMonth()+1;
    if(mon<10){
        mon="0"+mon;
    }
    var day = date.getDate();
    if(day<10){
        day="0"+day;
    }
    var hours = date.getHours();
    if(hours<10){
        hours="0"+hours;
    }
    var minu = date.getMinutes();
    if(minu<10){
        minu="0"+minu;
    }
    var sec = date.getSeconds();
    if(sec<10){
        sec="0"+sec;
    }
    if(type==''||type==undefined||type==null||type=="YY-MM-DD hh:mm:ss"){
        return year+'-'+mon+'-'+day+' '+hours+':'+minu+':'+sec;
    }else if(type=="YY-MM-DD"){
        return year+'-'+mon+'-'+day;
    }else if(type=="NONE"){
        return year+""+mon+""+day+""+hours+""+minu+""+sec;
    }
}
exports.getTimes=getTimes;
exports.extend=extend;